package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.SysUser;
import com.example.entity.vo.RoleRight;
import com.example.entity.vo.UsrRole;
import com.example.mapper.SysUserMapper;
import com.example.service.ISysUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2024-09-10
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
    @Resource
    SysUserMapper sysUserMapper;

    @Override
    public SysUser searchAllByUsrNameAndUsrPassword(String usrName, String usrPassword) {
        return sysUserMapper.searchAllByUsrNameAndUsrPassword(usrName, usrPassword);
    }

    @Override
    public UsrRole searchAllByUsrName(String usrName) {
        return sysUserMapper.searchAllByUsrName(usrName);
    }

    @Override
    public List<RoleRight> selectByUsrRoleIdRoleRight() {
        return sysUserMapper.selectByUsrRoleIdRoleRight();
    }

    @Override
    public RoleRight selectByUsrRoleIdRole(String usrName,String rightUrl) {
        return sysUserMapper.selectByUsrRoleIdRole(usrName,rightUrl);
    }

    @Override
    public Boolean insertSysUser(String usrName, String usrPassword, String usrEmail, String usrAccount) {
        return sysUserMapper.insertSysUser(usrName, usrPassword, usrEmail, usrAccount);
    }
}
